package com.example.mylazyviewpager;

import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import java.util.ArrayList;

public class MyFragmentAdaptor extends FragmentPagerAdapter {
    private static final String TAG = "MyFragmentAdaptor";
    private ArrayList<? extends Fragment> fragmentList;
    public MyFragmentAdaptor(FragmentManager fm, ArrayList<? extends Fragment> fragmentList) {
        super(fm);
        this.fragmentList = fragmentList;
    }

    @Override
    public Fragment getItem(int position) {
        return fragmentList.get(position);
    }

    @Override
    public int getCount() {
        return fragmentList.size();
    }
}
